﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta name="csrf-token" content="{{ csrf_token() }}">
  <title>无标题文档</title>
<link rel="stylesheet" type="text/css" href="admin/css/public.css">
</head>

<body>
<div  id="main">
<h2>管理员添加</h2>
<table border="0"    cellspacing="20" cellpadding="0">
  <tr>
    <td>用户名：</td>
    <td><input   type="text" name="username" id="username" class="username"/></td>
  </tr>
  <tr>
    <td>密码：</td>
    <td><input  type="password" name="psd"   id=psdclass class="psd"/></td>
  </tr>
  <tr>
    <td>性别：</td>
    <td>
    <input   type="radio"  name="sex" id="sex"  class="sex" checked="checked"/>男
    <input   type="radio"  name="sex"  id="sex"   class="sex" />女</td>
  </tr>
    <tr>
    <td>爱好：</td>
    <td>
    <input   type="checkbox" class="hobby" value="上网" name="hobby"/>上网
    <input   type="checkbox" class="hobby" value="体育"  name="hobby"/>体育
    <input   type="checkbox" class="hobby" value="学习"   name="hobby"/>学习
    </td>
  </tr>
      <tr>
    <td>城市：</td>
    <td>
    <select name="city"  class="s1" id="city">
    	<option value="北京">北京</option>
        <option value="上海">上海</option>
        <option value="南京">南京</option>
    </select>
    </td>
  </tr>

  <tr>
      <td>介绍:</td>
      <td>
           <textarea  name="introduce" id="introduce" class="textarea"></textarea>
      </td>
  </tr>
  
  <tr>
    <td>角色:</td>
    <td>
      <select name="js" id="js">
        <option value="新闻管理权限">新闻管理权限</option>
        <option value="新闻管理员">新闻管理员</option>
        <option value="分类管理员">分类管理员</option>
        <option value="超级管理员">超级管理员</option>
      </select>
    </td>
  </tr>

  <tr>
    <td>&nbsp;</td>
    <td><input  type="submit" value="添 加"   id="sub" class="sub" /><input  type="reset" value="重 置"  class="res"/></td>
  </tr>
</table>
</div>
</body>
</html>
<script src="jquery.js"></script>
<script>
  $(function(){
      $('#sub').click(function(){
          var username=$('.username').val();
          var psd=$('.psd').val();
          var sex=$('.sex').val();
          var hobby=$('.hobby').val();
          var city = $('.city').text();
          var introduce=$('.introduce').val();
          var js=$('.js').text();
          $.ajax({
              url:"one_admin_add",
              type:"post",
              data:{
                  username:"username",
                  psd:"psd",
                  sex:"sex",
                  hobby:"hobby",
                  city:"city",
                  introduce:'introduce',
                  js:"js",
                  '_token':'csrf_token()'

              },
              success:function(e){
                  if(e==2){
                      alert('成功');
                      window.location.href="http://www.xm.hk/one_admin_list";
                  }else{
                      alert('失败');
                  }
              }
          })
      })
  })
</script>
